/*
 *  Copyright (C) 2009  Peter Kist & Jan Ripke
 *
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef __logic_gamestate_states_gamestate_h
#define __logic_gamestate_states_gamestate_h 1

#include <vector>

#include <logic/gamestate/State.h>
#include <world/Universe.h>
#include <world/Types.h>

namespace galaxy {

    namespace world {
        class Universe;
    }

    namespace logic {
        namespace gamestate {
            namespace states {

                typedef enum __gametype {
                    SINGLE_PLAYER = 1,
                    MULTI_PLAYER = 2,
                } GameType;

                /** The GameState is the main entry point to the running game.
                * It serves as an entry point to important data that is relevant to the game (such as the game
                * type (single/multi player, the universe object, etc...)
                * 
                * The game state is responsible for the following:
                *   - create/delete NCP's
                *   - create/delete player
                *   - set/get game type (single/multi player)
                *   - manage Universe Entity
                */
                class GameState: public gamestate::State
                {
                    GameType         m_GameType;
                    world::EntityPtr m_Universe;

                public:

                    GameState();
                    virtual ~GameState(void);

                    virtual bool setupState ();
                    virtual bool activateState ();
                    virtual bool terminateState ();

                    virtual const char * stateName () { return "GameState"; };

                    GameType getGameType () { return m_GameType; };
                    void setGameType (GameType gameType) { m_GameType = gameType; };

                    // FIXME: move this method to the relevant engine
                    /** Display the specified entities. 
                     The entities are sent to the gfx module and made visible there.
                     @param entities A vector of entities to display
                     @return true upon success, false upon failure.
                     */
                    bool displayEntities (std::vector<world::EntityPtr>& entities);

                    world::EntityPtr& getUniverse () { return m_Universe; };
                };

            } // namespace states
        } // namespace gamestate
    } // namespace logic
} // namespace galaxy

#endif // __logic_gamestate_states_gamestate_h
